﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mimoza.Transport;

namespace Mimoza.AgentLayer.Communication
{
    public class RequestBroadcastServerAddress : TransferObjectGenericWithoutReply<RequestBroadcastServerAddress>
    {
        public RequestBroadcastServerAddress()
        {
        }

        public RequestBroadcastServerAddress(string hostId, string hostName,
            int countNum, int agentUDPPort)
        {
            m_hostId = hostId;
            m_hostName = hostName;
            m_countNumber = countNum;
            m_agentUDPPort = agentUDPPort;
        }

        public string HostId
        {
            get { return m_hostId; }
            set { m_hostId = value; }
        }

        public string HostName
        {
            get { return m_hostName; }
            set { m_hostName = value; }
        }

        public int CountNumber
        {
            get { return m_countNumber; }
            set { m_countNumber = value; }
        }

        public int AgentUDPPort
        {
            get { return m_agentUDPPort; }
            set { m_agentUDPPort = value; }
        }
        string m_hostId;
        string m_hostName;
        int m_countNumber = 0;
        int m_agentUDPPort = 0;
    }

    public class RequestSetServerAddress : TransferObjectGenericWithoutReply<RequestSetServerAddress>
    {
        public RequestSetServerAddress()
        {
        }

        public RequestSetServerAddress(string hostId, string serverHostName, string serverIpAddr)
        {
            m_toHostId = hostId;
            m_serverHostName = serverHostName;
            m_serverIpAddress = serverIpAddr;
        }

        public string ToHostId
        {
            get { return m_toHostId; }
            set { m_toHostId = value; }
        }

        public string ServerHostName
        {
            get { return m_serverHostName; }
            set { m_serverHostName = value; }
        }

        public string ServerHostIpAddr
        {
            get { return m_serverIpAddress; }
            set { m_serverIpAddress = value; }
        }

        public bool IsFromServer
        {
            get { return m_requestFromServerFlag; }
            set { m_requestFromServerFlag = value; }
        }

        string m_toHostId;
        string m_serverHostName;
        string m_serverIpAddress;
        bool m_requestFromServerFlag = true;
    }
}
